﻿using SUNRPA.CONTROLS.IMPL.domain;
using SUNRPA.CONTROLS.IMPL.domain.flowItemParam;
using SUNRPA.CONTROLS.IMPL.domain.flowRunningVar;
using SUNRPA.CONTROLS.IMPL.util;
using System.Collections.Concurrent;

namespace SUNRPA.CONTROLS.IMPL.controls {
    public class WaitNAction:BaseControlActions {
        public override int Execute(int currentIndex, FlowItem item, ConcurrentDictionary<string, ConcurrentDictionary<string, RPAVariableDefineWrapper>> globleData, List<FlowItem> flowItems) {
            WaitNParam? param = item.ControlParam as WaitNParam;
            string wt = param.WaitTime;
            this.GetStringVar(ref wt, globleData);
            int watiTime = int.Parse(wt);
            Thread.Sleep(watiTime * 1000);
            return currentIndex;
        }
    }
}
